package cn.lg.soar.common.data.dict;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.Objects;

/**
 * @author luguoxiang
 * @date 2022/6/3
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
public class DictItem<V> implements IDict<V> {

    private V value;

    private String label;

    @Override
    public boolean equals(Object object) {
        if (this == object) {
            return true;
        }
        if (object == null || getClass() != object.getClass()) {
            return false;
        }
        DictItem<V> item = (DictItem<V>) object;
        return Objects.equals(value, item.value);
    }

    @Override
    public int hashCode() {
        return Objects.hash(value);
    }
}
